class Version < ActiveRecord::Base
  attr_accessible :description, :imgName, :theme, :time, :sourceName
  class << self
    def new_version(time,theme,imgName,description,sourceName)
      new_version = Version.new(:time => time,:theme => theme,:imgName => imgName,:description => description,:sourceName => sourceName)
      if new_version.save
        return new_version
      end
      nil
    end
    def update_version(time,theme,imgName,description,id)
      Version.find_by_id(id).update_attributes(:time => time,:theme => theme,:imgName => imgName,:description => description)
    end
  end
end
